<div class="x_panel">
  <div class="x_content row">
    <div class="col-xs-12">
      <form class="form-horizontal form-label-left" action="{$actionUrl}" method="post" enctype="multipart/form-data">
        <div class="form-group">

          <label class="control-label col-md-2 col-sm-4 col-xs-12">合作商编号：<b style="color:red">*</b></label>
          <div class="checkbox col-md-10 col-sm-8 col-xs-12">
            <input class="form-control col-md-3 col-xs-12" required="required" type="text" name="form[partner_no]" value="{$partner.partner_no}">
          </div>

          <label class="control-label col-md-2 col-sm-4 col-xs-12">合作商名称：<b style="color:red">*</b></label>
          <div class="checkbox col-md-10 col-sm-8 col-xs-12">
            <input class="form-control col-md-3 col-xs-12" required="required" type="text" name="form[partner_name]" value="{$partner.partner_name}">
          </div>

          <label class="control-label col-md-2 col-sm-4 col-xs-12">联系人：<b style="color:red">*</b></label>
          <div class="checkbox col-md-10 col-sm-8 col-xs-12">
            <input class="form-control col-md-3 col-xs-12" required="required" type="text" name="form[linkman]" value="{$partner.linkman}">
          </div>
          <label class="control-label col-md-2 col-sm-4 col-xs-12">联系电话：<b style="color:red">*</b></label>
          <div class="checkbox col-md-10 col-sm-8 col-xs-12">
            <input class="form-control col-md-3 col-xs-12" required="required" type="text" name="form[linkphone]" value="{$partner.linkphone}">
          </div>
          <label class="control-label col-md-2 col-sm-4 col-xs-12">联系邮箱：<b style="color:red">*</b></label>
          <div class="checkbox col-md-10 col-sm-8 col-xs-12">
            <input class="form-control col-md-3 col-xs-12" required="required" type="text" name="form[linkemail]" value="{$partner.linkemail}">
          </div>
          <label class="control-label col-md-2 col-sm-4 col-xs-12">FTP服务器账号：<b style="color:red">*</b></label>
          <div class="checkbox col-md-10 col-sm-8 col-xs-12">
            <input class="form-control col-md-3 col-xs-12" required="required" type="text" name="form[ftp_username]" value="{$partner.ftp_username}">
          </div>
          <label class="control-label col-md-2 col-sm-4 col-xs-12">FTP服务器密码（不填为不修改）：</label>
          <div class="checkbox col-md-10 col-sm-8 col-xs-12">
            <input class="form-control col-md-3 col-xs-12" type="text" name="form[ftp_password]" value="">
            <br>
            <button id="send-password" data="{$partner.partner_id}" onclick="return false">发送密码</button>
          </div>

          <label class="control-label col-md-2 col-sm-4 col-xs-12">状态：<b style="color:red">*</b></label>
          <div class="checkbox col-md-10 col-sm-8 col-xs-12">
            <input class=""  type="radio" name="form[partner_status]" value="1" {if $partner.partner_status==1}checked="checked"{/if}>是
            <input class=""  type="radio" name="form[partner_status]" value="0" {if $partner.partner_status==0}checked="checked"{/if}>否
          </div>
          <label class="control-label col-md-2 col-sm-4 col-xs-12">备注：</label>
          <div class="checkbox col-md-10 col-sm-8 col-xs-12">
            <input class="form-control col-md-3 col-xs-12" type="text" name="form[partner_remark]" value="{$partner.partner_remark}">
          </div>

        </div>
        <div class="col-md-3 col-sm-12 col-xs-12 col-md-offset-4 col-sm-offset-4">
          <input name="partner_id" type="hidden" value="{$partner.partner_id}">
          <button class="btn btn-primary" type="submit">更新</button>
        </div>
      </form>
    </div>
  </div>
</div>
<script>
    $("#send-password").click(function () {
        var partner_id = $(this).attr('data');
        var url = "{['partner/send-password']|U}";
        $.post(url, 'partner_id='+partner_id, function (data) {
            alert("发送成功！！！");
        },'json');
    })
</script>
